const express = require('express');
const app = express();

app.use((request, err, next) => {
    console.log("服务1被访问");
    next();
})

app.get('/students',(request,response)=>{
    const students=[
        {id:"001",name:"Tom",age:10},
        {id:"002",name:"Tony",age:12},
        {id:"003",name:"Jerry",age:13},

    ]
    response.send(students);
})

app.listen(5000,(err)=>{
    if(!err) console.log("服务器1启动成功,访问地址是http://localhost:5000/students");
})